
<template>
  <div class="main">
    <div class="checkhead">
      <h1 class="stitle">
        <span>船舶舱单：</span>
        {{data.manifestNo}}
      </h1>
    </div>

    <div class="biaodan">
      <div class="vux-form-preview weui-form-preview">
        <div class="weui-form-preview__hd">
          <label class="weui-form-preview__label logofont">舱单详情</label>
          <em class="weui-form-preview__value">
            <img src="../assets/images/jjlogo.png" alt class="jjlogo">
          </em>
        </div>
        <div class="weui-form-preview__bd">
          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">航次</label>
            <span class="weui-form-preview__value">{{data.voyNo}}</span>
          </div>

          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">申报时间</label>
            <span class="weui-form-preview__value">{{data.declareDate}}</span>
          </div>

          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">船名</label>
            <span class="weui-form-preview__value">{{data.shipName}}</span>
          </div>

          <div class="weui-form-preview__item">
            <label class="weui-form-preview__label">申报状态</label>
            <span
              class="weui-form-preview__value"
              v-bind:class="{'orangefont':data.declareStatus=='审核中','redfont' : data.declareStatus=='未通过','greenfont': data.declareStatus=='已通过'}"
            >{{data.declareStatus}}</span>
          </div>
        </div>
      </div>
      <div class="vux-form-preview weui-form-preview">
        <div class="weui-form-preview__ft">
          <a class="weui-form-preview__btn weui-form-preview__btn_default" @click="goBack">
            <span>返回上一页</span>
          </a>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { cookie, numberComma } from "vux";

export default {
  name: "mydeclareDetail",
  props: ["voyNo"],
  data() {
    return {
      data: {}
    };
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    }
  },
  mounted() {
    // let userInfo = cookie.get("userinfo");
    // userInfo = userInfo ? JSON.parse(userInfo) : {};
    // console.info("no---", this.voyNo);
    let voyNo = this.voyNo;
    this.$http({
      url: "/infService/shippingBill",
      // headers: {
      //   "x-token": userInfo.token
      // },
      params: {
        voyageNo: voyNo
      }
    }).then(resp => {
      if (resp.code === 200) {
        let data = resp.data;
        // data.netWt = numberComma(data.netWt);
        // data.packNo = numberComma(data.packNo);
        this.data = resp.data;
      } else {
        this.$vux.toast.text("请求数据失败");
      }
    });
  }
};
</script>

<style lang="less">
@import "../styles/weui/widget/weui_cell/weui_form/weui-form-preview.less";
.vux-form-preview {
  overflow: hidden;
}
</style>